package com.xhh.nphm.web.controller.system;

import com.xhh.nphm.common.core.controller.BaseController;
import com.xhh.nphm.system.service.IWfSendBackService;
import com.xhh.nphm.system.service.MwfSendBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RestController
@RequestMapping("/system/cmnTab")
public class CmnTabController extends BaseController {
    private final String prefix = "system/cmnTab";

    @Autowired
    private IWfSendBackService twfSendBackService;
    @Autowired
    private MwfSendBackService mwfSendBackService;

    /**
     * 电话拟派工单签收页面
     * @param sbId 派单编号
     */
    @GetMapping("/twfCSignS/{id}")
    public ModelAndView twfCSignS(@PathVariable("id") Integer sbId, ModelMap map){
        map.put("sbId",sbId);
        map.put("wfId",twfSendBackService.getById(sbId).getWfId());
        return new ModelAndView(prefix+"/twfCSignS");
    }


    /**
     * 电话拟派工单签收页面
     * @param sbId 派单编号
     * @param wfId 工单主键
     */
    @GetMapping("/twfCReplyS/{id}")
    public ModelAndView twfCReplyS(@PathVariable("id") Integer sbId, Long wfId, ModelMap map){
        map.put("sbId",sbId);
        map.put("wfId",wfId);
        return new ModelAndView(prefix+"/twfCReplyS");
    }


    /**
     * 电话拟派工单审核回复页面
     * @param sbId 派单编号
     */
    @GetMapping("/twfCChkS/{id}")
    public ModelAndView twfCChkS(@PathVariable("id") Integer sbId, ModelMap map){
        map.put("sbId",sbId);
        map.put("wfId",twfSendBackService.getById(sbId).getWfId());
        return new ModelAndView(prefix+"/twfCChkS");
    }


    /**
     * 电话待分发下级处理页面
     * @param sbId 派单编号
     */
    @GetMapping("/twfCSendWait/{id}")
    public ModelAndView twfCSendWait(@PathVariable("id") Integer sbId, ModelMap map){
        map.put("sbId",sbId);
        map.put("wfId",twfSendBackService.getById(sbId).getWfId());
        return new ModelAndView(prefix+"/twfCSendWait");
    }

    /**
     * 电话待签收转派处理页面
     * @param sbId 派单编号
     */
    @GetMapping("/twfCSendWaitZP/{id}")
    public ModelAndView twfCSendWaitZP(@PathVariable("id") Integer sbId,Integer wfId,ModelMap map){
        map.put("sbId",sbId);
        map.put("wfId",wfId);
        return new ModelAndView(prefix+"/twfCSendWaitZP");
    }

    /**
     * 下级退回信件拟派工单列表页面
     * @param sbId 派单编号
     */
    @GetMapping("/twfCSonBackListS")
    public ModelAndView twfCSonBackListS(){
        return new ModelAndView(prefix+"/twfCSonBackListS");
    }

    /**
     * 下级已办毕T 电话列表页面
     *
     * @return
     */
    @GetMapping("/tListSonOverTab")
    public ModelAndView tListSonOverTab() {
        return new ModelAndView(prefix + "/tListSonOverTab");
    }

    /**
     * 下级已办毕T 信件列表页面
     *
     * @return
     */
    @GetMapping("/mListSonOverTab")
    public ModelAndView mListSonOverTab() {
        return new ModelAndView(prefix + "/mListSonOverTab");
    }


    /**
     * 信件拟派工单签收页面
     * @param sbId 派单编号
     */
    @GetMapping("/mwfCSignS/{id}")
    public ModelAndView mwfCSignS(@PathVariable("id") Integer sbId, ModelMap map){
        map.put("sbId",sbId);
        map.put("wfId",mwfSendBackService.getById(sbId).getWfId());
        return new ModelAndView(prefix+"/mwfCSignS");
    }


    /**
     * 信件拟派工单回复页面
     * @param sbId 派单编号
     * @param wfId 工单主键
     */
    @GetMapping("/mwfCReplyS/{id}")
    public ModelAndView mwfCReplyS(@PathVariable("id") Integer sbId, Long wfId, ModelMap map){
        map.put("sbId",sbId);
        map.put("wfId",wfId);
        return new ModelAndView(prefix+"/mwfCReplyS");
    }



    /**
     * 信件拟派工单审核回复页面
     * @param sbId 派单编号
     */
    @GetMapping("/mwfCChkS/{id}")
    public ModelAndView mwfCChkS(@PathVariable("id") Integer sbId, ModelMap map){
        map.put("sbId",sbId);
        map.put("wfId",mwfSendBackService.getById(sbId).getWfId());
        return new ModelAndView(prefix+"/mwfCChkS");
    }

    /**
     * 信件待分发下级处理页面
     * @param sbId 派单编号
     */
    @GetMapping("/mwfCSendWait/{id}")
    public ModelAndView mwfCSendWait(@PathVariable("id") Integer sbId, ModelMap map){
        map.put("sbId",sbId);
        map.put("wfId",mwfSendBackService.getById(sbId).getWfId());
        return new ModelAndView(prefix+"/mwfCSendWait");
    }


    /**
     * 信件待回复处理页面
     * @param wfId 工单编号
     */
    @GetMapping("/mailWFShowWllz/{id}")
    public ModelAndView mailWFShowWllz(@PathVariable("id") Integer wfId, ModelMap map){
        map.put("wfId",wfId);
        return new ModelAndView(prefix+"/mailWFShowWllz");
    }

    /**
     * 下级退回信件拟派工单列表页面
     */
    @GetMapping("/mwfCSonBackListS")
    public ModelAndView mwfCSonBackListS(){
        return new ModelAndView(prefix+"/mwfCSonBackListS");
    }
    /**
     * 电话待处理页面
     * @return
     */
    @GetMapping("/tWait")
    public ModelAndView tWait() {
        return new ModelAndView(prefix + "/tWait");
    }

    /**
     * 审核本级回复T 审核本级回复+本部门已办毕
     *
     * @return
     */
    @GetMapping("/tAuditPeerReplyTab")
    public ModelAndView tAuditPeerReplyTab() {
        return new ModelAndView(prefix + "/tAuditPeerReplyTab");
    }

    /**
     * 审核本级回复M 审核本级回复+本部门已办毕
     *
     * @return
     */
    @GetMapping("/mAuditPeerReplyTab")
    public ModelAndView mAuditPeerReplyTab() {
        return new ModelAndView(prefix + "/mAuditPeerReplyTab");
    }
}
